package com.huluobo.a2109mvpimdemo.demo;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.util.Log;
import android.view.MotionEvent;

import com.huluobo.a2109mvpimdemo.R;

/**
 * 触摸事件 包括常用事件,手指按下(down) 手指抬起(up) 手指移动(move)
 */
public class TouchDemoActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_touch_demo);
    }

    @Override
    public boolean dispatchTouchEvent(MotionEvent ev) {
        Log.i("TagA", "activity:分发" + ev.getAction());
        return super.dispatchTouchEvent(ev);
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        Log.i("TagA", "activity:消费" + event.getAction());
        return super.onTouchEvent(event);
    }
}